<?php
/*
 * add thumbnail size
 */
add_image_size('recent-work-thumb', 265, 150);

/*
 * define domain name for translate
 */
define('DOMAIN_TRANS', 'vnwp');

/*
 * define theme name
 */
define('THEME_NAME', 'vnwp');

/*
 * define theme directory
 */
define('THEME_URI', get_bloginfo('stylesheet_directory') . '/');

/*
 * define body classes constant
 */
define('THEMATIC_COMPATIBLE_BODY_CLASS', true);

/*
 * add menu
 */
register_nav_menus(
		array(
		//'navigator' => __('Main navigator', DOMAIN_TRANS)
		));

/*
 * get img tag in images folder 
 */
function get_img_src($img_name, $alt = '', $class = "") {
	$html = '<img alt="' . $alt . '" src="' . THEME_URI . 'images/' . $img_name
			. '" class="' . $class . '"/>';
	return $html;
}

/*
 * get img tag base on timthumb script
 */
function get_timthumb_img_src($src, $width, $height, $alt = '', $class = "",
		$title = '') {
	$src = THEME_URI
			. "inc/timthumb/timthumb.php?src=$src&w=$width&h=$height&zc=1";
	$html = '<img alt="' . $alt . '" src="' . $src . '" class="' . $class
			. '" title="' . $title . '"/>';
	return $html;
}

/*
 * add filter to change wp-pagenavi to vnwp-pagenavi
 */
function function_to_add($out) {
	return str_replace('wp-pagenavi', 'vnwp-pagenavi', $out);
}
add_filter('wp_pagenavi', 'function_to_add');

/*
 * admin theme options
 */
include_once 'inc/options.php';

/*
 * override header
 */
include_once 'inc/header.php';

/*
 * override header
 */
include_once 'inc/single.php';

/*
 * override index
 */
include_once 'inc/index.php';

/*
 * add some widgets
 */
include_once 'inc/widgets.php';

/*
 * sidebar extensions
 */
include_once 'inc/sidebar.php';
/*
 * archive page
 */
include_once 'inc/archive.php';
/*
 * comments page
 */
include_once 'inc/comments.php';

